<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>html5绘图</title>
    <link rel="stylesheet" href="https://cdn.bootcdn.net/ajax/libs/weui/2.4.4/style/weui.min.css">
    <script defer src="https://cdn.bootcdn.net/ajax/libs/three.js/r128/three.min.js"></script>  
    <script src="./1.js" async></script>
    <script src="./2.js" async></script>
    <!-- script标签 会阻塞，defer async 不阻塞 
    defer 会在DOMContentLoaded周期前按编写顺序执行
    async 允许并行 会在最后按加载速度顺序执行
    -->
    <style>
        #canvas{
            background: #000;
        }
    </style>
</head>
<body>
    <h1>sjkf sgsg</h1>
    <script>
        console.log('阻塞');
    </script>
    <canvas id="canvas" width="400" height="400"></canvas>
    <script>
        document.addEventListener('DOMContentLoaded',function(){
            console.log('DOMContentLoading');
        })
    </script>
    <script>
        var canvas=document.getElementById('canvas');   // 标签对象
        var context=canvas.getContext('2d'); //平面  ，webgl 3d  上下文句柄

        context.beginPath();  // 开始路径
        // line circle
        context.arc(100,100,50,0,Math.PI*2,true);
        context.closePath();  // 结束路径
        context.fillStyle='rgb(255,255,255)';
        context.fill();
    </script>
</body>
</html>